package com.hdu.dwh.pojos.model_pojos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.hdu.dwh.enums.JoinType;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class ConnectionColumn {
    @TableId(type = IdType.AUTO)
    @Schema(hidden = true)
    private Integer id;

    public ConnectionColumn(String l_db, String l_tb, String l_col, String r_db, String r_tb, String r_col, JoinType joinType, Long modelId) {
        this.leftDatabaseName = l_db;
        this.leftTableName = l_tb;
        this.leftColumnName = l_col;
        this.rightDatabaseName = r_db;
        this.rightTableName = r_tb;
        this.rightColumnName = r_col;
        this.joinType = joinType;
        this.modelId = modelId;
    }

    @Schema(hidden = true)
    private Long modelId;

    private String leftDatabaseName;

    private String rightDatabaseName;

    private String leftTableName;

    private String rightTableName;

    private String leftColumnName;

    private String rightColumnName;
    
    private JoinType joinType;
}
